package com.rsstuan.utils;

import java.util.HashMap;
import java.util.Map;

public class CharSetUtils {
	public static final String DEFAULT_ENCODING = "UTF-8";
	public static final Map<String, String> getCharSetMap() {
		Map<String, String> map = new HashMap<String, String>();
		map.put("55tuan", "gbk");
		map.put("meituan", "UTF-8");
		map.put("groupon.cn", "gbk");
		
		return map;
		
	}

	public static String getCharSetByUrl(String url) {
		Map<String, String> map = getCharSetMap();
		for (String key : map.keySet()) {
			if (url.contains(key))
				return map.get(key);
		}
		return DEFAULT_ENCODING;	
	}
	
	

}
